package com.min.gps;

import com.min.gps.service.nio.SocketServer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.io.IOException;
import java.net.Socket;

@SpringBootApplication
@EnableSwagger2
public class GPSApplication {
private final static Logger log =LogManager.getLogger( GPSApplication.class);
  private static Socket socket;
    public static void main(String[] args) throws IOException {
   SpringApplication application = new SpringApplication(GPSApplication.class);
        Environment environment = application.run(args).getEnvironment();
   log.info("SwaggerUI: 	http://localhost:" + environment.getProperty("server.port") + "/swagger-ui.html");

//        //报文解析服务
// DataServer server= new DataServer(socket);
// server.startServer();
   //     new MultiThreadServer().service();
new SocketServer().start();
    }
}
